package com.app.bimo.module_bookrack.mvp.model.api.service;



import com.app.bimo.commonbusiness.bean.BaseResult;
import com.app.bimo.library_db.BookData;
import com.app.bimo.library_db.SearchData;
import com.app.bimo.module_bookrack.mvp.model.entiy.FindData;
import com.app.bimo.module_bookrack.mvp.model.entiy.OtherResult;

import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.DELETE;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface BookrackService {
    /**
     * 书架  删除  阅读时长
     *
     * @param page
     * @return
     */
    @GET("bookshelf")
    Observable<BaseResult<List<BookData>>> getBooks(@Query("page") String page);

    @DELETE("bookshelf")
    Observable<BaseResult<Object>> delBooks(@Query("novelid") String novelid);

    @GET("week/readtime")
    Observable<BaseResult<OtherResult>> weekReadTime();

    /**
     * 阅读足迹
     *
     * @param page
     * @return
     */
    @GET("account/novel/read")
    Observable<BaseResult<List<BookData>>> getReadRecordBooks(@Query("page") String page);

    @DELETE("account/novel/read")
    Observable<BaseResult<Object>> delReadRecordBooks();

    @DELETE("account/novel/read")
    Observable<BaseResult<Object>> delReadRecordBooks(@Query("novelid") String novelid);

    /**
     * 搜索
     */
    @GET("hot/search")
    Observable<BaseResult<List<SearchData>>> getHotSearch();

    @GET("search")
    Observable<BaseResult<List<SearchData>>> getSearch(@Query("keyword") String keyword, @Query("page") int page);

    /**
     * 发现
     */
    @GET("discovery")
    Observable<BaseResult<List<FindData>>> getFind(@Query("channel") int channel, @Query("page") int page);

    /**
     * 分享奖励
     *
     * @return
     */
    @FormUrlEncoded
    @POST("share/reward")
    Observable<BaseResult<OtherResult>> shareReward(@Field("type") int type, @Field("shareTime") String shareTime, @Field("sign") String sign);

    /**
     * 书架页面
     *
     * @return
     */

    @GET("bookshelf/recommend")
    Observable<BaseResult<BookData>> getBookshelfRecommend();

    /**
     * 书架页面 公告
     *
     * @return
     */

    @GET("announce")
    Observable<BaseResult<List<OtherResult>>> getAnnounce();

    /**
     * 书架页面 头部广告
     *
     * @return
     */

    @GET("banner")
    Observable<BaseResult<List<OtherResult>>> getBanner(@Query("position") int position);

}